package com.amigo.online.provider.user.mapper;


import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import com.amigo.online.common.core.mybatis.MyMapper;
import com.amigo.online.provider.user.model.entity.VerificationCode;

@Mapper
@Component
public interface VerificationCodeMapper extends MyMapper<VerificationCode> {


    /**
     * 获取5分中内收到手机验证码并且未验证的条数
     */
    int getMobilephoneFiveMinutesCount(@Param("mobilephone") String mobilephone, @Param("countryCode") String countryCode);

    /**
     * 根据手机号，验证码，类型获取记录
     *
     * @param mobilephone
     * @param code
     * @param type
     * @return
     */
    VerificationCode getByCode(@Param("mobilephone") String mobilephone, @Param("code") String code, @Param("type") Integer type);

    /**
     * 根据手机号，验证码，类型获取记录 用来获取国家代码
     *
     * @param mobilephone
     * @param code
     * @param type
     * @return
     */
    VerificationCode getCountryCodeByCode(@Param("mobilephone") String mobilephone, @Param("code") String code, @Param("type") Integer type);


    void batchUpdateStatus(@Param("vcodeList") List<VerificationCode> vcodeList);

}
